package com.yonyou.pmclouds.basecom.runtime;

public class DevRuntimeEnvironment {
    public static final String DEV_DEST_KEY = "dubbo-dest";
    private static ThreadLocal<EnvironmentObject> threadLocal = new ThreadLocal<EnvironmentObject>() {
        protected EnvironmentObject initialValue() {
            return new EnvironmentObject();
        }
    };

    public static void resetCurrentThread() {
        threadLocal.get().reset();
    }

    public static String getDestHost() {
        return threadLocal.get().dest;
    }

    public static void setDestHost(String dest) {
        threadLocal.get().dest = dest;
    }

    static class EnvironmentObject {
        private String dest;

        protected void reset() {
            dest = null;
        }
    }
}
